package com.qqtop10.manager.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.ModelMap;

import com.qqtop10.manager.dao.AdminMapper;
import com.qqtop10.manager.model.Admin;
import com.qqtop10.manager.model.AdminRole;
import com.qqtop10.manager.model.PagingArgs;
import com.qqtop10.manager.model.RebateLink;
import com.qqtop10.manager.service.AdminService;

@Service("adminService")
public class AdminServiceImpl extends BaseService implements AdminService {

	@Autowired
	private AdminMapper adminMapper;

	@Override
	public Admin get(Admin input) {
		return adminMapper.get(input);
	}
	
	@Override
	public List<AdminRole> getAdminRole(AdminRole input) {
		return adminMapper.getAdminRole(input);
	}
	
	@Override
	public boolean modifyPassword(Admin input) {
		return adminMapper.modifyPassword(input) != 0;
	}

	@Override
	public int updateUserUuid(Admin input) {
		return adminMapper.updateUserUuid(input);
	}

	@Override
	public List<Admin> all(Admin input, PagingArgs pagingArgs) {
		return adminMapper.all(asMap(input, pagingArgs));
	}
	
	@Override
	public int count(Admin input){
		return adminMapper.count(input);
	}
	
	@Override
	public int delete(int id){
		return adminMapper.delete(id);
	}
	
	@Override
	public int update(Admin input){
		return adminMapper.update(input);
	}
	
	@Override
	public int insert(Admin input){
		return adminMapper.insert(input);
	}
	
	@Override
	public int insertAdminRole(AdminRole input){
		return adminMapper.insertAdminRole(input);
	}

	
	public int deleteAdminByuuid(Admin input) {
		return adminMapper.deleteAdminByuuid(input);
	}
	
}
